/*********************************************************************************
  *Copyright (C), 2016-2023, jiance.zhang
  *FileName:  xcp_if.c
  *Author:  JianCe.Zhang
  *Version:  V1.0
  *Date: 2024-05-02
  *Description: 
  *Function List:
  * 1. void function(void)
  * 2. 
  * 3. 
  * 4. 
  *History:
  * 1. 2024-05-02;JianCe.Zhang;Init Function 
  * 2. 
  * 3. 
  * 4. 
****************************************Includes***********************************/
#include "main.h"
#include "xcp_if.h"
#include "CAN_Module.h"

/***************************************Variables***********************************/



/***************************************Functions***********************************/
void ApplXcpSend( uint8_t len, const uint8_t* msg )
{
    CAN_Module_Write(0, 0x201, 0, 0, (uint8_t *)msg, len);
}

void ApplXcpInterruptEnable( void )
{
    return;
}

void ApplXcpInterruptDisable( void )
{
    return;
}


void CalData_Copy(void)
{
	/*标定数据段的初始化*/
	extern uint32_t _sicaldata,_scaldata,_ecaldata;
	uint32_t* P_Target = &_scaldata;
	uint32_t* P_Source = &_sicaldata;
	for(;P_Target<&_ecaldata;P_Target++,P_Source++)
	{
		*((uint32_t*)P_Target) = *((uint32_t*)P_Source);
	}
}

uint8_t* ExtAddr2Addr( uint8_t addr_ext, uint32_t addr )
{
    return (uint8_t*)addr;
}